class CreateEconnections < ActiveRecord::Migration
  def self.up
    create_table :econnections do |t|
      t.string :eterm_name       ,:limit => 16   #Eterm登录用户名
      t.string :eterm_pswd       ,:limit => 16   #Eterm登录密码
      t.integer :level           ,:limit => 1    #Eterm应用级别,比如公司内是0,分公司是1,代理商是乐票是2,个人乐票是3.
      t.integer :is_locked       ,:limit => 1 ,:default => 0 #是否管理会要锁定 1为True 0为False
      t.integer :lock_version    , :default => 0 #乐观锁
      t.timestamps
    end
    Econnection.create(:eterm_name => 'tao22070',:eterm_pswd=>'tao22070',:level =>0)
    Econnection.create(:eterm_name => 'tao22071',:eterm_pswd=>'tao22071',:level =>0)
    Econnection.create(:eterm_name => 'tao22072',:eterm_pswd=>'tao22072',:level =>0)
  end

  def self.down
    drop_table :econnections
  end
end
